package com.linux.huhx.thread;


import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by huhx on 2017/5/23.
 */
public class TimerTest {
    public static void main(String[] args) {
        new Thread().start();

        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello world");
            }
        }, 1000, 2000);
        ThreadLocal threadLocal = new InheritableThreadLocal();
        while (true) {
            System.out.println("sleep");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
